#include <stdio.h>
#include <ctype.h>
#include <string.h>
#include <stdbool.h>
#define STOP '|'
int main()
{
    char c;
    bool is_space = 0;
    int cam = 0, nam = 1, wam = 0;
    while ((c = getchar()) != STOP){
        cam++;
        if (c == '\n')
        {
            nam++;
        }
        if(!isspace(c)){
            wam++;
            break;
        }
    }
    while ((c = getchar()) != STOP)
    {
        cam++;
        if (isspace(c))
        {

            is_space = 1;
        }
        else
        {
            if (is_space == 1)
            {
                wam++;
            }
            is_space = 0;
        }
        if (c == '\n')
        {
            nam++;
        }
    };
    printf("%5d\n%5d\n%5d\n",cam,nam,wam);

    return 0;
}